package com.lanou3g.demo.base;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public abstract class BaseFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        BaseRequest request = new BaseRequest((HttpServletRequest) servletRequest);
        BaseResponse response = new BaseResponse((HttpServletResponse) servletResponse);
        doFilter(request,response,filterChain);
    }

   public abstract void doFilter(HttpServletRequest req, HttpServletResponse resp,FilterChain filterChain) throws IOException, ServletException;


    @Override
    public void destroy() {

    }
}
